<?php
include("config/connect.php");
include("public/common.php");

function GetLastKey( $url, $key )
{
	$key .= "=";
	$nStart = stripos( $url, $key );
	if( $nStart !== false )
	{
		$nStart += strlen( $key );
		return htmlspecialchars(base64_decode(substr( $url, $nStart )), ENT_QUOTES );
	}
	return "";
}

$p = base64_decode( CheckUrlParamNoDie( "p" ) );
$p = EnCode( $p, "_goshopping_" );
$p = "&" . $p;

$un = GetKey($p, "un");
$args = htmlspecialchars( GetKey($p, "args"), ENT_QUOTES );
$type = GetKey($p, "type");
$ip = gethostbyname($_SERVER["REMOTE_ADDR"]);

$sql = "insert into admin_report(un, args, type, ip) values('$un', '$args', '$type', '$ip')";
$result = mysql_query( $sql );
if( $result )
{
	ReturnTrue();
}
else 
{
	ReturnFalse("添加失败。");
}
?>